package com.tarena.flight_game;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class GameFrame extends JFrame {
	int x,y;

	private MainPanel p1;
	public GameFrame(){
		p1 = new MainPanel(this);
		this.add(p1,BorderLayout.CENTER);
	}
	
	public void showMe(){
		//使窗体居中
		x = Toolkit.getDefaultToolkit().getScreenSize().width/2;
		y = Toolkit.getDefaultToolkit().getScreenSize().height;
		this.setSize(x,y);
		this.setLocation(x/2,0);
		this.setResizable(false);
		this.setTitle("GAME");
		this.setCursor(Cursor.CROSSHAIR_CURSOR);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
	}
	
	public static void main (String s[]){
		GameFrame w = new GameFrame();
		w.showMe();
	}
}
